const path = require('path')
const files = require.context('./', true, /\.vue$/)
import {toCamel} from 'utils/helper/common'

const components = {}
files.keys().forEach(key => {
	// console.log('key:::', key)
	let name = key.indexOf('index.vue') > -1 ? path.dirname(key).replace('./', '') : path.basename(key,'.vue')
	name = toCamel(name)
	components[name] = files(key).default || files(key)
})

export default components